function saveLottery()
{
	 jQuery("#lotteryForm").ajaxSubmit(
           {
              type:"post",
              clearForm: true,        // 是否清空form  
              resetForm: true,       // 是否重置form  
              success:function(data)
              { 
                 var d= eval("("+data+")");
                 if(d.STATUS=="0")
                 {
                    alert("修改成功！");
                    location.href=base+"/lotteryService.do";
                 }
                 else
                 {
                    alert(d.MSG);
                 }
              }
           }
          );
}


function changePlayGroup()
{
	var lotteryType=jQuery("#lotteryType").val();
    $.ajax({
        type: "POST",
        url: base+"/lotteryService/queryLotteryPlayGrooup.do",  
        data: {lotteryType:lotteryType}, 
        success: function(data){ 
              jQuery("#defailtPlayGroupId").children().remove();
              data=eval("("+data+")");
              for(var i=0;i<data.length;i++)
              {
            	  if(defaultPlayGroupId==data[i].id)
            	  {
            		  jQuery("<option value='"+data[i].id+"' selected>"+data[i].name+"</option>").appendTo("#defailtPlayGroupId"); 
            	  }
            	  else
            	  {
            		  jQuery("<option value='"+data[i].id+"'>"+data[i].name+"</option>").appendTo("#defailtPlayGroupId"); 
            	  }
              }
           } 
        }
    );  
}

jQuery(function()
{
    	changePlayGroup(defaultPlayGroupId);//加载玩法组下拉控件
}		
);